Interface Environment

All Superinterfaces:
IPCObject
All Known Implementing Classes:
EnvironmentImpl

public interface Environment extends IPCObject
Information provided by the PKI file:

    \class Environment
    
    \brief An object in the Physical Workspace.
    
    \example appWindow().getActiveWorkspace().getRootPhysicalObject().getEnvironment()
    
Author:
Auto-generated
  • Method Details

    • pauseTime

      void pauseTime()
      Information provided by the PKI file:
      
          \brief Pauses the environment time.
          
              
    • resumeTime

      void resumeTime()
      Information provided by the PKI file:
      
          \brief Resumes the environment time.
          
              
    • isTimeRunning

      boolean isTimeRunning()
      Information provided by the PKI file:
      
          \brief Returns true if the environment time is running, false if paused.
          
          \return bool, true if the environment time is running, false if paused.
          
              
      Returns:
      boolean Returns a boolean
    • getTimeInSeconds

      int getTimeInSeconds()
      Information provided by the PKI file:
      
          \brief Returns the current environment runtime, in seconds.  The value loops, so after 24 hours it resets to 0.
          
          \return int, the current environment runtime, in seconds.
          
              
      Returns:
      int Returns a int
    • setTimeInSeconds

      void setTimeInSeconds(int seconds)
      Information provided by the PKI file:
      
          \brief Sets the current environment time to the given time, in seconds.  Time loops every 24 hours.
          
          \param seconds, the number of seconds to set the current environment time to.  Time loops every 24 hours so the valid range is [0, 86400).
          
              
      Parameters:
      seconds - Takes in a parameter of seconds
    • getTimeMultiplier

      float getTimeMultiplier()
      Information provided by the PKI file:
      
          \brief Multiplier used when calculating how much environment time passes each step, in seconds.
          
          \return float, the current environment runtime, in seconds.
          
              
      Returns:
      float Returns a float
    • setTimeMultiplier

      void setTimeMultiplier(float x)
      Information provided by the PKI file:
      
          \brief Sets the multiplier used when calculating how much environment time passes each step, in seconds.
          
          \param x, the number of seconds to set the step multipler as.
          
              
      Parameters:
      x - Takes in a parameter of x
    • getKeyframeCount

      int getKeyframeCount()
      Information provided by the PKI file:
      
          \brief How many key frames are in the environment.
          
          \return int, the number of key frames in the environment.
          
              
      Returns:
      int Returns a int
    • getKeyframeAt

      EnvironmentKeyframe getKeyframeAt(int index)
      Information provided by the PKI file:
      
          \brief How Returns a keyframe at a specified index.
          
          \param index, the keyframe to retrive.  Range of [0, getKeyframeCount()).
          
          \return EnvironmentKeyframe, the keyframe at the given index.
          
              
      Parameters:
      index - Takes in a parameter of index
      Returns:
      EnvironmentKeyframe Returns a EnvironmentKeyframe
    • addKeyframe

      EnvironmentKeyframe addKeyframe(int timeInSeconds)
      Information provided by the PKI file:
      
          \brief Adds a keyframe at the specified time and returns the new keyframe.
          
          \param time, the time to add the keyframe at, in seconds.  Time loops every 24 hours so the valid range is [0, 86400).
          
          \return EnvironmentKeyframe, the keyframe added.
          
              
      Parameters:
      timeInSeconds - Takes in a parameter of timeInSeconds
      Returns:
      EnvironmentKeyframe Returns a EnvironmentKeyframe
    • hasKeyframeAtTime

      boolean hasKeyframeAtTime(int time)
      Information provided by the PKI file:
      
          \brief Returns if there is a keyframe at the given time.
          
          \param time, time in seconds to retrive the keyframe for.  Time loops every 24 hours so the valid range is [0, 86400).
          
          \return bool, true if there was a keyframe, false if not.
          
              
      Parameters:
      time - Takes in a parameter of time
      Returns:
      boolean Returns a boolean
    • getKeyframeIndexAtTime

      int getKeyframeIndexAtTime(int time)
      Information provided by the PKI file:
      
          \brief Returns the index of a keyframe at the given time if one exists.
          
          \param time, time in seconds to retrive the keyframe index for.  Time loops every 24 hours so the valid range is [0, 86400).
          
          \return int, value is the index if a match was found, -1 if not.
          
              
      Parameters:
      time - Takes in a parameter of time
      Returns:
      int Returns a int
    • getStagingKeyframe

      EnvironmentKeyframe getStagingKeyframe()
      Information provided by the PKI file:
      
          \brief Returns the staging keyframe.
          
          \return EnvironmentKeyframe, value is the staging keyframe.
          
              
      Returns:
      EnvironmentKeyframe Returns a EnvironmentKeyframe
    • addKeyframeFromStaging

      int addKeyframeFromStaging()
      Information provided by the PKI file:
      
          \brief Adds a keyframe from staging.
          
          \return int, value is index of the keyframe after it gets added from staging.
          
              
      Returns:
      int Returns a int
    • removeKeyframe

      void removeKeyframe(int index)
      Information provided by the PKI file:
      
          \brief Removes the keyframe at the given index if the keyframe exists and isn't the start or end.
          
          \param index, index of the keyframe to remove.  Range of (1, getKeyframeCount()-1).
          
              
      Parameters:
      index - Takes in a parameter of index
    • getEnvironmentOptionsCount

      int getEnvironmentOptionsCount()
      Information provided by the PKI file:
      
          \Returns how many environment value types there are.  Categories are not included in the count, just the contents of all combined.
          
          \return int, value is the count of all environment values.
          
              
      Returns:
      int Returns a int
    • getEnvironment

      EnvironmentOptions getEnvironment(String env)
      Information provided by the PKI file:
      
          \brief Returns the options for a specified environment value type, like "CO" for carbon monoxide.
          
          \param env, name of the environment value to retrive, like "CO".
          
          \return EnvironmentOptions, value is the options for the specificed environment value type.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      EnvironmentOptions Returns a EnvironmentOptions
    • getEnvironmentKeys

      List<String> getEnvironmentKeys()
      Information provided by the PKI file:
      
          \brief Returns a list of all the environment value types.
          
          \return vector<QString>, value is a list of all the environment value types.
          
              
      Returns:
      List<String> Returns a List<String>
    • getEnvironmentValue

      float getEnvironmentValue(String env)
      Information provided by the PKI file:
      
          \brief Returns the value for the specified environment property.
          
          \param env, name of the environment value to retrive, like "CO".
          
          \return float, value is the value of the environment value.  If not found it will return -1, but that can also be a valued value.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      float Returns a float
    • getUnit

      String getUnit(String env)
      Information provided by the PKI file:
      
          \brief Returns the unit used for the specified environment property.
          
          \param env, name of the environment value to retrive, like "CO".
          
          \return QString, value is the unit displayed for the environment value type, like "%" for gasses.  The return can be an empty string.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      String Returns a String
    • getValueWithUnit

      String getValueWithUnit(String env)
      Information provided by the PKI file:
      
          \brief Returns a string combining the specified environment property and the display unit is uses.
          
          \param env, name of the environment value to retrive, like "CO".
          
          \return QString, value is a string combining the specified environment property and the display unit is uses.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      String Returns a String
    • getMetricValue

      float getMetricValue(String env)
      Information provided by the PKI file:
      
          \brief Returns the metric value for the given environment value.
          
          \param env, name of the environment value to retrive, like "CO".
          
          \return float, value is the metric value of the environment value.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      float Returns a float
    • setCurrentKeyTime

      void setCurrentKeyTime(int t)
      Parameters:
      t - Takes in a parameter of t
    • setNextKeyTime

      void setNextKeyTime(int t)
      Parameters:
      t - Takes in a parameter of t
    • setEditMode

      void setEditMode(boolean bOn)
      Parameters:
      bOn - Takes in a parameter of bOn
    • isEditMode

      boolean isEditMode()
      Information provided by the PKI file:
      
          \brief Returns true if the environment editor window is in Edit mode.
          
          \return bool, value is true if the enviroment window is in Edit mode, false if it is in View mode.
          
              
      Returns:
      boolean Returns a boolean
    • exportToFile

      void exportToFile()
      Information provided by the PKI file:
      
          \brief Starts the process for saving the environment window values to an xml file.
          
              
    • importFromFile

      void importFromFile()
      Information provided by the PKI file:
      
          \brief Starts the save process for importing the environment window values from an xml file.
          
              
    • setAllActive

      void setAllActive(String envId, boolean bOn)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets them active/inactive.
          
          \param envId, name of the environment to check keyframes for.
          \param bOn, true if keyframes containing the value should be activated, false if deactivated.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      bOn - Takes in a parameter of bOn
    • setKeyframeActive

      void setKeyframeActive(int currentKeyframeIndex, String envId, boolean bOn)
      Information provided by the PKI file:
      
          \brief Sets the specified keyframe to active and the environment value in it to be active.
          
          \param currentKeyframeIndex, index of the keyframe to set.
          \param envId, name of the environment to set for in the keyframe.
          \param bOn, true if keyframes containing the value should be activated, false if deactivated.
          
              
      Parameters:
      currentKeyframeIndex - Takes in a parameter of currentKeyframeIndex
      envId - Takes in a parameter of envId
      bOn - Takes in a parameter of bOn
    • setAllShow

      void setAllShow(String envId, boolean bOn)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for show.
          
          \param envId, name of the environment to check keyframes for.
          \param bOn, true if keyframes containing the value and the value should be shown, false if not shown.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      bOn - Takes in a parameter of bOn
    • setAllTransference

      void setAllTransference(String envId, float value)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for transference.
          
          \param envId, name of the environment to check keyframes for.
          \param value, transference to use.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      value - Takes in a parameter of value
    • setAllInterpolate

      void setAllInterpolate(String envId, boolean bOn)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for interpolate.
          
          \param envId, name of the environment to check keyframes for.
          \param bOn, true to use interpolation, false to not.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      bOn - Takes in a parameter of bOn
    • setAllMin

      void setAllMin(String envId, float value)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for min value allowed.
          
          \param envId, name of the environment to check keyframes for.
          \param value, min value allowed by the environment value.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      value - Takes in a parameter of value
    • setAllMax

      void setAllMax(String envId, float value)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for max value allowed.
          
          \param envId, name of the environment to check keyframes for.
          \param value, max value allowed by the environment value.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      value - Takes in a parameter of value
    • setAllMinRate

      void setAllMinRate(String envId, float value)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for min rate allowed.
          
          \param envId, name of the environment to check keyframes for.
          \param value, min rate value used by the environment value.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      value - Takes in a parameter of value
    • setAllMaxRate

      void setAllMaxRate(String envId, float value)
      Information provided by the PKI file:
      
          \brief Goes through all keyframes and staging keyframes and looks for keyframes with the given environment value type and sets the stored value for max rate allowed.
          
          \param envId, name of the environment to check keyframes for.
          \param value, max rate value used by the environment value.
          
              
      Parameters:
      envId - Takes in a parameter of envId
      value - Takes in a parameter of value
    • setManualAdjustment

      void setManualAdjustment(String env, float value)
      Information provided by the PKI file:
      
          \brief Sets the manual adjustment property of the given environment value type.
          
          \param env, the name of the environment value type to set the property for.  Like "CO2".
          
          \param value, value to set the env property value with.
          
              
      Parameters:
      env - Takes in a parameter of env
      value - Takes in a parameter of value
    • getCumulativeContribution

      float getCumulativeContribution(String env, String devName)
      Information provided by the PKI file:
      
          \brief Retrives the cumulative contribution for a device and environment value type.
          
          \param env, name of the environment to read the value for.
          \param devName, device to find the environment value for.
          
          \return float, value is the cumulative contribution based on the params.
          
              
      Parameters:
      env - Takes in a parameter of env
      devName - Takes in a parameter of devName
      Returns:
      float Returns a float
    • setContribution

      void setContribution(String env, String devName, double rate, double limit, boolean bCumulative)
      Information provided by the PKI file:
      
          \brief Sets the rate, limit and if it is cumulative properties for the environment value for the specified device.
          
          \param env, name of the environment value to set the values for.
          \param devName, device to set for.
          \param rate, rate to use.  If 0 it wipes out all the values and doesn't set any of the values passed.
          \param limit, limit to use.
          \param bCumulative, true if it should be set to cumulative, false if not.
          
              
      Parameters:
      env - Takes in a parameter of env
      devName - Takes in a parameter of devName
      rate - Takes in a parameter of rate
      limit - Takes in a parameter of limit
      bCumulative - Takes in a parameter of bCumulative
    • removeCumulativeContribution

      void removeCumulativeContribution(String env, String devName)
      Information provided by the PKI file:
      
          \brief Removes the cumulative contribution for the environment value and device pair.
          
          \param env, name of the environment value to remove for.
          \param devName, device to remove for.
          
              
      Parameters:
      env - Takes in a parameter of env
      devName - Takes in a parameter of devName
    • setThingTransferenceMultiplier

      void setThingTransferenceMultiplier(String env, String devName, float multiplier)
      Information provided by the PKI file:
      
          \brief Sets the thing transference multipler the environment value and device pair.
          
          \param env, name of the environment value to remove for.
          \param devName, device to remove for.
          \param multiplier, multiplier to store.
          
              
      Parameters:
      env - Takes in a parameter of env
      devName - Takes in a parameter of devName
      multiplier - Takes in a parameter of multiplier
    • getTotalContributions

      float getTotalContributions(String env)
      Information provided by the PKI file:
      
          \brief Retrives the total contribution for all environment entries of the given environment value type.
          
          \param env, name of the environment to read the value for.
          
          \return float, value is the total contribution based of the given environment value type.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      float Returns a float
    • getSimTimeSetting

      int getSimTimeSetting()
      Information provided by the PKI file:
      
          \brief Retrives second value of the "Simulation Time Scale:".
          
          \return int, retun is the value of the second property of "Simulation Time Scale:".
          
              
      Returns:
      int Returns a int
    • getRealTimeSetting

      int getRealTimeSetting()
      Information provided by the PKI file:
      
          \brief Retrives first value of the "Simulation Time Scale:".
          
          \return int, retun is the value of the first property of "Simulation Time Scale:".
          
              
      Returns:
      int Returns a int
    • getSimTimeCombo

      int getSimTimeCombo()
      Returns:
      int Returns a int
    • getRealTimeCombo

      int getRealTimeCombo()
      Returns:
      int Returns a int
    • setSimTimeSetting

      void setSimTimeSetting(int s)
      Parameters:
      s - Takes in a parameter of s
    • setRealTimeSetting

      void setRealTimeSetting(int s)
      Parameters:
      s - Takes in a parameter of s
    • setSimTimeCombo

      void setSimTimeCombo(int s)
      Parameters:
      s - Takes in a parameter of s
    • setRealTimeCombo

      void setRealTimeCombo(int s)
      Parameters:
      s - Takes in a parameter of s
    • isUsingMetric

      boolean isUsingMetric()
      Information provided by the PKI file:
      
          \brief Returns if the environment is using the metric system or imperial.
          
          \return bool, retun is true if the environment it set to use the metric system, false for imperial.
          
              
      Returns:
      boolean Returns a boolean
    • getNotes

      String getNotes()
      Returns:
      String Returns a String
    • setNotes

      void setNotes(String s)
      Parameters:
      s - Takes in a parameter of s
    • isShowNotes

      boolean isShowNotes()
      Information provided by the PKI file:
      
          \brief Returns if notes are set to show in the environment advanced options window.
          
          \return bool, retun is true if notes are set to show, false if set to hidden.
          
              
      Returns:
      boolean Returns a boolean
    • setShowNotes

      void setShowNotes(boolean b)
      Information provided by the PKI file:
      
          \brief Sets the environment window property for whether notes should be shown in the advanced window.
          
          \param b, true to set notes to show when advanced options are viewied, false if they should be hidden.
          
              
      Parameters:
      b - Takes in a parameter of b
    • isEditingLocked

      boolean isEditingLocked()
      Information provided by the PKI file:
      
          \brief Returns if the environment editing window has been locked by interace locking option.
          
          \return bool, retun is true if the environment window is locked, false if not.
          
              
      Returns:
      boolean Returns a boolean
    • addCustomEnvironment

      void addCustomEnvironment(String categoryId, String category, String id, String name, String metricUnit, String imperialUnit, String imperialFormula, String metricFormula)
      Information provided by the PKI file:
      
          \brief Adds a custom environment value type to the environment.
          
          \param categoryId, category to add the value to, like "Radiation" or "Other".
          \param category, category to add, make it the same as categoryId.
          \param id, name of the environment value.  Like "Sweetness"
          \param name, name to display in the editor window for the environment value.
          \param metricUnit, metric unit to display when display the value is in metric units.
          \param imperialUnit, imperial unit to display when value is in imperial units.
          \param imperialFormula, conversion formula to convert from
          
              
      Parameters:
      categoryId - Takes in a parameter of categoryId
      category - Takes in a parameter of category
      id - Takes in a parameter of id
      name - Takes in a parameter of name
      metricUnit - Takes in a parameter of metricUnit
      imperialUnit - Takes in a parameter of imperialUnit
      imperialFormula - Takes in a parameter of imperialFormula
      metricFormula - Takes in a parameter of metricFormula
    • removeCustomEnvironment

      void removeCustomEnvironment(String env)
      Information provided by the PKI file:
      
          \brief Removes a custom environment value type from the environment.  This is only for custom properties, not for included properties like "CO2".
          
          \param env, name of the environment value.  Like "Sweetness"
          
              
      Parameters:
      env - Takes in a parameter of env
    • isCustomEnvironment

      boolean isCustomEnvironment(String env)
      Information provided by the PKI file:
      
          \brief Returns true if the environment value is a custom environment value.
          
          \return bool, return is true if the environment exists and is a custom property or doesn't exist, false if it is not custom.
          
              
      Parameters:
      env - Takes in a parameter of env
      Returns:
      boolean Returns a boolean
    • getNextKeyTime

      int getNextKeyTime()
      Information provided by the PKI file:
      
          \brief Debugging tool for getting the next keyframe time.
          
          \return int, return is the next keyframe time.
          
              
      Returns:
      int Returns a int
    • getCurrentKeyTime

      int getCurrentKeyTime()
      Information provided by the PKI file:
      
          \brief Debugging tool for getting the current keyframe time.
          
          \return int, return is the current keyframe time.
          
              
      Returns:
      int Returns a int
    • getElapsedTime

      int getElapsedTime(int lastTime)
      Information provided by the PKI file:
      
          \brief Returns the time difference between the given time and the current environment time, in seconds.
          
          \param lastTime, time to subtract from the current time to find the difference.
          
          \return int, return is the time difference between the current time and the given time.
          
              
      Parameters:
      lastTime - Takes in a parameter of lastTime
      Returns:
      int Returns a int
    • getKeyframeTemplateCount

      int getKeyframeTemplateCount()
      Information provided by the PKI file:
      
          \brief Returns how many default keyframe categores there are in the "Defaults:" section of the environment window when setting up advanced keyframes.
          
          \return int, return is how many default keyframe categores there are in the "Defaults:" section of the environment window when setting up advanced keyframes.
          
              
      Returns:
      int Returns a int
    • getKeyframeTemplateAt

      String getKeyframeTemplateAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the default keyframe template name at the given index.
          
          \param index, index of the template to retrive.  Range (0, getKeyFrameTemplateCount())
          
          \return QString, return is the default keyframe template name at the given index if it exists, crash if it doesn't.
          
              
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • importKeyframeTemplate

      void importKeyframeTemplate(String file)
      Information provided by the PKI file:
      
          \brief Starts importing a default keyframe template.
          
          \param file, the name of the template to import.  Like "Blank.xml".
          
          \return QString, return is the default keyframe template name at the given index if it exists, crash if it doesn't.
          
              
      Parameters:
      file - Takes in a parameter of file
    • parentEnvironment

      Environment parentEnvironment()
      Information provided by the PKI file:
      
          \brief Returns the parent environment.
          
          \return Environment, return is the parent environment if it exists, null if not.
          
              
      Returns:
      Environment Returns a Environment
    • setGraphEnvironment

      void setGraphEnvironment(String env)
      Parameters:
      env - Takes in a parameter of env
    • getGraphEnvironment

      String getGraphEnvironment()
      Returns:
      String Returns a String
    • getVolume

      float getVolume()
      Information provided by the PKI file:
      
          \brief Returns the total volume of the object that contains the environment.
          
          \return float, return is the total volume of the object that contains the environment.
          
              
      Returns:
      float Returns a float
    • getChangesAsJSON

      String getChangesAsJSON()
      Information provided by the PKI file:
      
          \brief Returns change information as JSON data.
          
          \return QString, return is the change information as JSON data.
          
              
      Returns:
      String Returns a String
    • getKeyframeDataAsJSON

      String getKeyframeDataAsJSON(String envID)
      Information provided by the PKI file:
      
          \brief Returns keyframes with the given environment value as JSON data.
          
          \param envID, the environment variable type to get the information for.
          
          \return QString, return is the keyframes' information for the given environment value as JSON data.
          
              
      Parameters:
      envID - Takes in a parameter of envID
      Returns:
      String Returns a String
    • removeEnvironmentKeyframe

      boolean removeEnvironmentKeyframe(String envID, int time)
      Information provided by the PKI file:
      
          \brief Removes the environment keyframe at the given time if it has the given environment variable type and it isn't the start or end keyframe.
          
          \param envID,  the environment variable type that must be in the specified keyframe time for it to be removed.
          \param time, the environment time of the keyframe to remove.
          
          \return bool, return is true a keyframe was removed, false if not.
          
              
      Parameters:
      envID - Takes in a parameter of envID
      time - Takes in a parameter of time
      Returns:
      boolean Returns a boolean